Maintenance method for network connection and computer system

ABSTRACT

A maintenance method for network connection and a computer system are provided. The method is adapted to a computer system having a real-time clock. The real-time clock is configured to regularly wake up the computer system to check whether a network connection is working normally. In the method, a wake up operation to wake up the computer system is received from a user. It is determined whether a connection time of maintaining the network connection so far from a last time of entering a power saving mode is greater than a counting time for the real-time clock to wake up the computer system. It is tested whether the network connection is working normally when the connection time is greater than the counting time. The counting time of the real-time clock is updated to the connection time when the network connection is working normally.

CROSS-REFERENCE TO RELATED APPLICATION

This application claims the priority benefit of Taiwan applicationserial no. 103139204, filed on Nov. 12, 2014. The entirety of theabove-mentioned patent application is hereby incorporated by referenceherein and made a part of this specification.

BACKGROUND

1. Technical Field

The invention relates to a maintenance method for network connection,and particularly relates to a method for maintaining a networkconnection by regularly waking up a system and a computer systemthereof.

2. Related Art

In recent years, along with quick development of computer technology,remote control techniques become more and more popular. A user canoperate a computer system from a remote end through a network atanywhere anytime. For example, the user at home can operate a computersystem in office through remote control, so as to obtain required dataor perform remote operations. A system manager can obtain informationsuch as a hardware status, a system event log, etc. of the computersystem from the remote end through remote control, so as to learn thestatus of the computer system at anytime without being limited by timeand space.

In today's remote control techniques, the user can perform an operationof wake on LAN (WOL) to a computer system that has entered a powersaving mode through a network via a transmission control protocol (TCP),so as to access data in the computer system from the remote end.However, after the computer system enters the power saving mode for aperiod of time, a network connection established through the TCP isprobably interrupted, which may result in a fact that the user cannotimplement the WOL to the computer system through the network. Therefore,the computer system generally has a mechanism capable of automaticallyrecovering from the power saving mode to a normal mode for maintainingthe network connection, such that the remote control can continuallywork normally.

Regarding the aforementioned mechanism of automatically recovering fromthe power saving mode, although the current computer system can beautomatically waken up during the network interruption through a settingof a network card, a design cost of the network card is relatively high,and the network connection cannot be maintained in case that an Internetprotocol address (IP address) is changed according to a dynamic hostconfiguration protocol (DHCP) or a point-to-point protocol over Ethernet(PPPoE). Therefore, a real-time clock (RTC) can be used to wake up thecomputer system in a regular way, so as to maintain the networkconnection. However, a connection time that the computer systemmaintains a normal operation of the network connection under the powersaving mode can be different according to different networkenvironments, which leads to difficulty in setting of a counting time ofthe RTC for waking up the computer system, and if the counting time istoo long, the network interruption cannot be effectively prevented, andif the counting time is too short, a power consumption of the computersystem is increased and a hardware service life thereof is decreased dueto too frequent wakeup of the computer system.

SUMMARY

The invention is directed to a maintenance method for network connectionand a computer system, by which a counting time of a real-time clock(RTC) is gradually adjusted to a counting time that is most suitable fora current network environment, so as to maintain a normal operation ofthe network connection and avoid unnecessary cost waste.

The invention provides a maintenance method for network connection,which is adapted to a computer system having a real-time clock. Thereal-time clock is configured to regularly wake up the computer systemto check whether a network connection is working normally. In themethod, a wake up operation of the computer system is received from auser to wake up the computer system. Then, it is determined whether aconnection time that the computer system maintains the networkconnection so far from a last time of entering a power saving mode isgreater than a counting time for the real-time clock to wake up thecomputer system. It is tested whether the network connection is workingnormally when the connection time is greater than the counting time. Thecounting time of the real-time clock is updated to the connection timewhen the network connection is working normally.

The invention provides a computer system including an input unit, anetwork card, a real-time clock and a processor. The input unit receivesa wake up operation. The network card establishes a network connection.When the computer system enters a power saving mode, the real-time clockregularly wakes up the computer system to determine whether the networkconnection is working normally. The processor receives a wake upoperation of the computer system from a user through the input unit towake up the computer system, and determines whether a connection timethat the computer system maintains the network connection established bythe network card so far from a last time of entering the power savingmode is greater than a counting time for the real-time clock to wake upthe computer system. The processor tests whether the network connectionis working normally when the connection time is greater than thecounting time. The processor updates the counting time of the real-timeclock to the connection time when the network connection is workingnormally.

According to the above descriptions, the maintenance method for networkconnection and the computer system of the invention use the real-timeclock to regularly wake up the computer system in the power saving modeto maintain a normal operation of the network connection. Moreover, theactual connection time of the computer system in the power saving modeunder the current network environment is determined, so as todynamically adjust the counting time of the real-time clock. In thisway, the counting time of the real-time clock is gradually adjusted to atime length that is more suitable for the current network environment,so as to reduce unnecessary power consumption and prolong a service lifeof computer hardware under a premise of successfully maintaining thenetwork connection.

In order to make the aforementioned and other features and advantages ofthe invention comprehensible, several exemplary embodiments accompaniedwith figures are described in detail below.

BRIEF DESCRIPTION OF THE DRAWINGS

The accompanying drawings are included to provide a furtherunderstanding of the invention, and are incorporated in and constitute apart of this specification. The drawings illustrate embodiments of theinvention and, together with the description, serve to explain theprinciples of the invention.

FIG. 1 is a block diagram of a computer system according to anembodiment of the invention.

FIG. 2 is a flowchart illustrating a maintenance method for networkconnection according to an embodiment of the invention.

FIG. 3 is a flowchart illustrating a maintenance method for networkconnection according to an embodiment of the invention.

FIG. 4 is a flowchart illustrating a maintenance method for networkconnection according to an embodiment of the invention.

FIG. 5 is an example of a maintenance method for network connectionaccording to an embodiment of the invention.

DETAILED DESCRIPTION OF DISCLOSED EMBODIMENTS

When a computer system is in an idle state, the computer systemgenerally enters a power saving mode to avoid unnecessary powerconsumption. Therefore, in the invention, when the computer systementers the power saving mode, a real-time clock (RTC) can be used toregularly wake up the computer system to maintain a network connection,so as to effectively maintain a normal operation of the networkconnection of the computer system. In this way, a user can access dataand status of the computer system at anytime anywhere to achieve aremote control effect.

FIG. 1 is a block diagram of a computer system according to anembodiment of the invention. Referring to FIG. 1, the computer system 10of the present embodiment is, for example, a computing device such as adesktop computer, a notebook, a server, etc., which includes an inputunit 12, a network card 14, an RTC 16 and a processor 18, and functionsthereof are described as follows.

The input unit 12 is, for example, a mouse, a keyboard, a touchpad or atouch panel having a resistive, a capacitive or other types of touchsensing element, which is capable of receiving a wake up operation ofthe computer system 10 from the user, so as to wake up the computersystem 10 in the power saving mode.

The network card 14 is, for example, a wireless network card supportinga wireless communication standard such as institute of electrical andelectronics engineers (IEEE) 802.11n/b/g, etc., or a network cardsupporting a cable network connection, which can establish a networkconnection with other external devices through a wireless or wiredmanner.

The RTC 16 can be any element having a timing function. When thecomputer system 10 enters the power saving mode, the RTC 16 canregularly wake up the computer system 10 to check whether the networkconnection of the computer system 10 is working normally.

The processor 18 is, for example, a central processing unit (CPU), or aprogrammable general purpose or special purpose microprocessor, adigital signal processor (DSP), a programmable controller, anapplication specific integrated circuit (ASIC), a programmable logicdevice (PLD) or other similar devices, or a combination of the abovedevices. The processor 14 is coupled to the input unit 12, the networkcard 14 and the RTC 16 to implement a maintenance function of thenetwork connection. An embodiment is provided below to describe detailedsteps of maintaining the network connection of the computer system 10.

FIG. 2 is a flowchart illustrating a maintenance method for networkconnection according to an embodiment of the invention. Referring toFIG. 1 and FIG. 2, the maintenance method for network connection of thepresent embodiment is adapted to the computer system 10 of FIG. 1, andsteps of the maintenance method for network connection of the inventionare described below with reference of various components of the computersystem 10.

In step S202, the processor 18 can receive a wake up operation of thecomputer system 10 from a user through the input unit 12 to wake up thecomputer system 10. In detail, in an embodiment, the input unit 12 is,for example, a mouse, a keyboard, a touchpad or a touch panel. When theuser performs the wake up operation of the computer system 10 throughthe input unit 12 (for example, the user moves the mouse or clicks thekeyboard, the touchpad and the touch panel, etc.), the processor 18 canreceive the wake up operation through the input unit 12, and accordinglywakes up the computer system 10 in the power saving mode to restore anormal mode thereof. It should be noticed that the power saving mode ofthe computer system 10 is, for example, the S3 mode specified by anadvanced configuration and power interface (ACPI), and the normal modeof the computer system 10 is, for example, the S0 mode, though theinvention is not limited thereto.

Then, in step S204, the processor 18 can determine whether a connectiontime that the computer system 10 maintains the network connection so farfrom a last time of entering the power saving mode is greater than acounting time for the RTC 16 to wake up the computer system 10. To bespecific, when the computer system 10 is operated by the user to recoverthe normal mode from the power saving mode, the processor 18 candetermine whether the connection time that the computer system 10maintains the network connection from a last time of entering the powersaving mode according to an operation of a user till a time of beingwaken up by the user is greater than the counting time of the RTC 16.During a period that the computer system 10 of the present embodimententers the power saving mode till the time of being waken up by theuser, the RTC 16 can regularly wake up the computer system 10 accordingto the counting time to maintain the network connection.

Then, in step S206, when the connection time is greater than thecounting time of the RTC 16, the processor 18 tests whether the networkconnection is working normally. For example, in an embodiment, theprocessor 18 transmits a test packet to a remote server (not shown) byusing the network card 14, and determines whether receiving anacknowledgement packet transmitted by the remote server in response tothe test packet, so as to determine whether the network connection ofthe computer system 10 is working normally, though the invention is notlimited thereto.

Finally, in step S208, when the network connection is working normally,the processor 18 updates the counting time of the RTC 16 to theconnection time. To be specific, when the network connection is workingnormally, the processor 18 updates the counting time of the RTC 16 tothe connection time, so as to dynamically adjust the counting time ofthe RTC 16 to a time length that is more suitable for the currentnetwork environment.

In another embodiment, when the computer system is waken up by the user,if the connection time that the computer system maintains the networkconnection in the power saving mode is not greater than the countingtime of the RTC, the RTC can continually accumulate for an extended timebefore the network connection is tested, so as to effectively adjust thecounting time of the RTC.

In detail, FIG. 3 is a flowchart illustrating a maintenance method fornetwork connection according to an embodiment of the invention.Referring to FIG. 1 and FIG. 3, the maintenance method for networkconnection of the present embodiment is adapted to the computer system10 of FIG. 1, and steps of the maintenance method for network connectionof the invention are described below with reference of variouscomponents of the computer system 10.

In step S302, the processor 18 can control the computer system to enterthe power saving mode according to an operation of a user or apredetermined condition. To be specific, the user can conduct a manualoperation; for example, press a power switch to manually notify theprocessor 18 to control the computer system to enter the power savingmode. Alternatively, the user can set a predetermined condition in anoperating system (for example, Microsoft Windows) executed by thecomputer system 10, for example, the predetermined condition is that asystem idle time is greater than a predetermined time, and when thepredetermined condition is satisfied, the processor 18 is automaticallynotified to control the computer system 10 to enter the power savingmode.

In step S304, the processor 18 can receive the wake up operation of thecomputer system 10 from the user through the input unit 12, so as towake up the computer system 10. Then, in step S306, the processor 18 candetermine whether a connection time that the computer system 10maintains the network connection so far from a last time of entering thepower saving mode is greater than a counting time for the RTC 16 to wakeup the computer system 10. If the connection time is greater than thecounting time, in step S308, the processor 18 tests whether the networkconnection is working normally. If the network connection is workingnormally, in step S310, the processor 18 updates the counting time ofthe RTC 16 to the connection time. The steps S304, S306, S308 and S310are respectively the same or similar to the steps S202, S204, S206 andS208 of the aforementioned embodiment, and details thereof are notrepeated.

Different to the aforementioned embodiment, after the step S306, if theconnection time of maintaining the network connection is not greaterthan the counting time of the RTC 16, in step S312, the RTC 16 cancontinually accumulate the connection time. Moreover, when theaccumulated connection time reaches an extended time, the processor 18can test whether the network connection is working normally, where theextended time is the current counting time plus a period of expansiontime. To be specific, when the computer system 10 is waken up by theuser, if the connection time of maintaining the network connection sofar from the last time of entering the power saving mode (not includinga situation of entering the power saving mode due to regular wakeup ofthe RTC 16) till the time of being waken up is not greater than thecounting time of the RTC 16, the RTC 16 can continually accumulate theconnection time, and when the connection time reaches the currentcounting time plus a period of expansion time (i.e., the extended time),the processor 18 tests whether the network connection is workingnormally.

If the network connection is working normally, in step S314, theprocessor 18 updates the counting time of the RTC 16 to the accumulatedconnection time, so as to adjust the counting time to a more suitablelength (which is more suitable for the current network environment).

If the network connection is interrupted, in step S316, the processor 18does not adjust the counting time, and re-establishes the networkconnection by using the network card 14, such that the user can useother devices to perform remote control to the computer system 10through the network. For example, the processor 18 can execute a networkmodule in the operating system of the computer system 10 to re-establishthe network connection between the computer system 10 and the Internetby using the network card 14, though the invention is not limitedthereto.

Similarly, after the step S308, if the network connection isinterrupted, in step S318, the processor 18 does not adjust the countingtime, and re-establishes the network connection by using the networkcard 14.

It should be noticed that in an embodiment, it is assumed that after thecounting time of the RTC is adjusted according to the aforementionedmethod, a situation of network interruption is encountered when the RTCregularly wakes up the computer system, the counting time of the RTC canbe recovered to a predetermined value for readjustment.

In detail, FIG. 4 is a flowchart illustrating a maintenance method fornetwork connection according to an embodiment of the invention.Referring to FIG. 1 and FIG. 4, the maintenance method for networkconnection of the present embodiment is adapted to the computer system10 of FIG. 1, and steps of the maintenance method for network connectionof the invention are described below with reference of variouscomponents of the computer system 10.

In step S402, the processor 18 regularly wakes up the computer system 10by using the RTC 16. To be specific, when the computer system 10 entersthe power saving mode, the RTC 16 keeps counting, and each time when thecounting time reaches a predetermined counting time, the RTC 16 wakes upthe computer system 10.

Then, in step S404, the processor 18 can test whether the networkconnection is working normally. To be specific, each time when thecomputer system 10 is waken up by the RTC 16; the processor 18 can testwhether the network connection is working normally.

In step S406, if the network connection is interrupted, the processor 18controls the RTC 16 to restore the counting time to a predeterminedvalue, and re-establishes the network connection by using the networkcard 14. To be specific, when the computer system 10 is regularly wakenup by the RTC 16, and it is tested that the network connection isinterrupted, the processor 18 can control the RTC 16 to restore thecounting time to the predetermined value, so as to readjust the countingtime of the RTC 16, and re-establish the network connection by using thenetwork card 14.

In another embodiment, the computer system can gradually adjust thecounting time of the RTC by repeating the steps of the aforementionedmaintenance method for network connection. For example, FIG. 5 is anexample of the maintenance method for network connection according to anembodiment of the invention. Referring to FIG. 1 and FIG. 5, the exampleof the maintenance method for network connection of the presentembodiment is adapted to the computer system 10 of FIG. 1. In thepresent example, an interactive relationship between the operations of auser at different time points and the computer system 10 is used todescribe the maintenance method for network connection of the invention.In FIG. 5, an axis CO to the left represents the operations of the user,an axis C1 in the middle represents the operations of the computersystem 10, and an axis C2 to the right represents the connection timethat the computer system 10 maintains the network connection afterentering the power saving mode. Moreover, in the present embodiment, forsimplicity's sake, the counting time of the RTC 16 is predetermined to10 minutes at the beginning, and an actual connection time that thecomputer system 10 maintains the network connection after entering thepower saving mode is assumed to be 45 minutes. The example of themaintenance method for network connection of the invention is describedbelow with reference of various components of the computer system 10.

At a time point t0, the user operates the computer system 10 toestablish the network connection. Then, at a time point t1, the useroperates the computer system 10 to enter the power saving mode. Afterentering the power saving mode, the RTC 16 of the computer system 10 canregularly wake up the computer system 10 to test the network connectionaccording to the preset counting time (10 minutes).

After 30 minutes, at a time point t2, the user wakes up the computersystem 10, and after the processor 18 of the computer system 10determines that the connection time (30 minutes) of maintaining thenetwork connection so far from a last time (the time point t1) that thecomputer system 10 is operated by the user to enter the power savingmode is greater than the counting time (10 minutes) for the RTC 16 toregularly wake up the computer system 10, the processor 18 tests whetherthe network connection is working normally. Now, since the connectiontime that the computer system 10 maintains the network connection afterentering the power saving mode is only 30 minutes, which is not greaterthan the actual connection time of 45 minutes, the test result indicatesthat the network connection is working normally. Therefore, the computersystem 10 updates the counting time of the RTC 16 to the connection time(30 minutes).

Then, after 20 minutes, at a time point t3, the user again operates thecomputer system 10 to enter the power saving mode. After entering thepower saving mode, the RTC 16 of the computer system 10 can regularlywake up the computer system 10 to test the network connection accordingto the current counting time (30 minutes).

After 50 minutes, at a time point t4, the user wakes up the computersystem 10, after the processor 18 of the computer system 10 determinesthat the connection time (50 minutes) of maintaining the networkconnection so far from a last time (the time point t3) that the computersystem 10 is operated by the user to enter the power saving mode isgreater than the counting time (30 minutes) for the RTC 16 to regularlywake up the computer system 10, the processor 18 can test whether thenetwork connection is working normally. At this time, since theconnection time that the computer system 10 maintains the networkconnection after entering the power saving mode is 50 minutes, which isgreater than the actual connection time of 45 minutes, the test resultat the time point t4 indicates that the network connection isinterrupted. Therefore, the computer system 10 does not update thecounting time of the RTC 16 to the connection time (50 minutes), butre-establishes the network connection through the network card 14.

Then, after 20 minutes, at a time point t5, the user again operates thecomputer system 10 to enter the power saving mode. After the computersystem enters the power saving mode for 20 minutes, at a time point t6,the user wakes up the computer system 10. Moreover, since the processor18 of the computer system 10 can determine that the connection time (20minutes) of maintaining the network connection so far from a last time(the time point t5) that the computer system 10 is operated by the userto enter the power saving mode is not greater than the counting time (30minutes) for the RTC 16 to regularly wake up the computer system 10, theRTC 16 of the computer system 10 can continually accumulate theconnection time, and it is tested whether the network connection isworking normally after the accumulated connection time reaches anextended time. In FIG. 5, the extended time is the current counting time(30 minutes) plus a period of expansion time (10 minutes). Then, at atime point t7 counted from the last time (the time point t5) that thecomputer system 10 is operated by the user to enter the power savingmode till the extended time (40 minutes), it is tested whether thenetwork connection of the computer system 10 is working normally. Atthis time, since the connection time that the computer system 10maintains the network connection after entering the power saving mode isonly 40 minutes, which is not greater than the actual connection time of45 minutes, the test result indicates that the network connection isworking normally. Therefore, the processor 18 of the computer system 10can update the counting time of the RTC 16 to the accumulated connectiontime (40 minutes), i.e., the counting time is adjusted from 30 minutesto 40 minutes, such that the counting time of the RTC 16 is more closeto the actual connection time of the computer system 10 after enteringthe power saving mode under the current network environment.

In summary, the maintenance method for network connection and thecomputer system of the invention use the RTC to wake up the computersystem in the power saving mode to maintain a normal operation of thenetwork connection. Moreover, the counting time of the RTC can bedynamically adjusted according to the actual connection time of thecomputer system measured when the computer system is waken up by theuser. In this way, the counting time of the RTC is adjusted to a timelength that is more suitable for the current network environment, so asto reduce unnecessary power consumption and prolong a service life ofcomputer hardware.

It will be apparent to those skilled in the art that variousmodifications and variations can be made to the structure of theinvention without departing from the scope or spirit of the invention.In view of the foregoing, it is intended that the invention covermodifications and variations of this invention provided they fall withinthe scope of the following claims and their equivalents.

What is claimed is:
 1. A maintenance method for network connection,adapted to a computer system having a real-time clock, wherein thereal-time clock is configured to regularly wake up the computer systemto check whether a network connection is working normally, themaintenance method for network connection comprising: receiving a wakeup operation of the computer system from a user to wake up the computersystem; determining whether a connection time that the computer systemmaintains the network connection so far from a last time of entering apower saving mode is greater than a counting time for the real-timeclock to wake up the computer system; testing whether the networkconnection is working normally when the connection time is greater thanthe counting time; and updating the counting time of the real-time clockto the connection time when the network connection is working normally.2. The maintenance method for network connection as claimed in claim 1,wherein after the step of determining whether the connection time isgreater than the counting time, the method further comprise: continuallyaccumulating the connection time when the connection time is not greaterthan the counting time, and testing whether the network connection isworking normally when the accumulated connection time reaches anextended time, wherein the extended time is the counting time plus aperiod of expansion time; and updating the counting time of thereal-time clock to the accumulated connection time when the networkconnection is working normally.
 3. The maintenance method for networkconnection as claimed in claim 1, further comprising: using thereal-time clock to regularly wake up the computer system; testingwhether the network connection is working normally; and restoring thecounting time to a predetermined value when the network connection isinterrupted, and re-establishing the network connection.
 4. Themaintenance method for network connection as claimed in claim 2, whereinafter the step of testing whether the network connection is workingnormally, the method further comprises: re-establishing the networkconnection when the network connection is interrupted.
 5. Themaintenance method for network connection as claimed in claim 1, whereinbefore the step of receiving the wake up operation of the computersystem from the user to wake up the computer system, the method furthercomprises: controlling the computer system to enter the power savingmode according to an operation of the use or a predetermined condition.6. A computer system, comprising: an input unit, receiving a wake upoperation; a network card, establishing a network connection; areal-time clock, wherein when the computer system enters a power savingmode, the real-time clock regularly wakes up the computer system todetermine whether the network connection is working normally; and aprocessor, coupled to the input unit, the network card and the real-timeclock, receiving a wake up operation of the computer system from a userthrough the input unit to wake up the computer system, and determiningwhether a connection time that the computer system maintains the networkconnection established by the network card so far from a last time ofentering the power saving mode is greater than a counting time for thereal-time clock to wake up the computer system, wherein the processortests whether the network connection is working normally when theconnection time is greater than the counting time, and the processorupdates the counting time of the real-time clock to the connection timewhen the network connection is working normally.
 7. The computer systemas claimed in claim 6, wherein the real-time clock continuallyaccumulates the connection time when the connection time is not greaterthan the counting time, and the processor tests whether the networkconnection is working normally when the accumulated connection timereaches an extended time, wherein the extended time is the counting timeplus a period of expansion time, and the processor updates the countingtime of the real-time clock to the accumulated connection time when thenetwork connection is working normally.
 8. The computer system asclaimed in claim 6, wherein the processor uses the real-time clock toregularly wake up the computer system, and tests whether the networkconnection is working normally, and the processor controls the real-timeclock to restore the counting time to a predetermined value when thenetwork connection is interrupted, and uses the network card tore-establish the network connection.
 9. The computer system as claimedin claim 7, wherein the processor uses the network card to re-establishthe network connection when the network connection is interrupted. 10.The computer system as claimed in claim 6, wherein the processorcontrols the computer system to enter the power saving mode according toan operation of the use or a predetermined condition.